<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="/WEB-INF/jsp/includeTaglib.jsp" %>


<div align="left" class="globalText paginationDiv" >
	<c:if test="${page.countData > 0}">
		<c:set var="countPage" value="${page.countPage}"/>
		<c:set var="gotoPage" value="${page.gotoPage}"/>
		<c:set var="showPerSize" value="5"/>
		
		
		<c:choose>
			<c:when test="${countPage<=showPerSize}">
				<c:set var="start" value="1"/>
				<c:set var="end" value="${countPage}"/>
			</c:when>
			<c:otherwise>
				<fmt:parseNumber var="temp" value="${showPerSize/2}" integerOnly="true"/>
				<c:choose>
					<c:when test="${showPerSize%2==0}">
						 <fmt:parseNumber var="start" value="${gotoPage-(temp-1)}" integerOnly="true"/>
						 <fmt:parseNumber var="end" value="${gotoPage+(temp+1)}" integerOnly="true"/>
					</c:when>
					<c:otherwise>
						<fmt:parseNumber var="start" value="${gotoPage-temp}" integerOnly="true"/>
						<fmt:parseNumber var="end" value="${gotoPage+temp}" integerOnly="true"/>
					</c:otherwise>
				</c:choose>
				<c:if test="${start<=0}">
					<c:set var="end" value="${end+(1-start)}"/>
					<c:set var="start" value="1"/>
				</c:if>
				<c:if test="${end>countPage}">
					<c:set var="start" value="${start-(end-countPage)}"/>
					<c:set var="end" value="${countPage}"/>
				</c:if>
			</c:otherwise>
		</c:choose>
		
		<c:if test="${page.hasPrePage}">
			<a href="javascript:searchDataByPage(1);">
				     首页
			</a>
			<a href="javascript:searchDataByPage(<c:out value="${page.prePage}" />);">
				     上一页
			</a>
		</c:if>
		
		
		<c:forEach var="index" begin="${start}" end="${end}" step="1">
			<c:choose>
				<c:when test="${index==gotoPage}">
					<b><c:out value="${index}"></c:out></b>
				</c:when>
				<c:otherwise>
					<a href="javascript:searchDataByPage(<c:out value="${index}"></c:out>);"><c:out value="${index}"></c:out></a>
				</c:otherwise>
			</c:choose>
		</c:forEach>


		<c:if test="${page.hasNextPage}">
			<a href="javascript:searchDataByPage(<c:out value="${page.nextPage}" />);">
				下一页 
			</a>
			<a href="javascript:searchDataByPage(<c:out value="${page.lastPage}" />);">
				末页
			 </a>
		</c:if>
		
		<input id="jumpnum" style="width: 26px;text-align: center;" type="text"  value="<c:out value="${gotoPage}" />" />
		<a href="javascript:void(0);" onclick="javascript:if($('#jumpnum').val()!=<c:out value="${gotoPage}" />)searchDataByPage($('#jumpnum').val());" >GO</a>
		
		<c:out value="${page.countData}" />
		条记录
		
		<c:out value="${gotoPage}" />/<c:out value="${countPage}" />
	</c:if>
</div>

<input type="hidden" id="page_pagesize" value="<c:out value="${page.pageSize}" />" />

